package com.neusoft.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 订单实体类
 *
 * @author Lucifer
 * @since 2021/5/16 14:32
 */
@Data
@TableName("`order`")
@ApiModel("订单表-order")
public class Order implements Serializable {

    private static final long serialVersionUID = 3148176768559230877L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户ID")
    private Integer user_id;

    @ApiModelProperty("状态：0.未提交，1.已提交（确认），2.已付款")
    private Integer status;

    @ApiModelProperty("订单总价")
    private Double total;

    @ApiModelProperty("创建时间")
    private Date create_time;

    @ApiModelProperty("提交时间")
    private Date submit_time;

    @ApiModelProperty("支付时间")
    private Date pay_time;

    @ApiModelProperty("订单包含商品ID集合")
    @TableField(exist = false)
    private Integer[] item_ids;

    @ApiModelProperty("订单包含商品")
    @TableField(exist = false)
    private List<Item> items;

    @ApiModelProperty("订单价格详情")
    @TableField(exist = false)
    private Price price;

    @ApiModelProperty("订单所属用户")
    @TableField(exist = false)
    private User user;

    @ApiModelProperty("所有商品名称")
    @TableField(exist = false)
    private String item_names;

}

